<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>29.类的继承</title>
</head>
<body>
<script>
  class Phone{
    constructor(brand,price) {
      this.brand = brand
      this.price = price
    }
    call(){
      console.log('打电话')
    }
  }

  class SmartPhone extends Phone{
    constructor(brand,price,color) {
      super(brand,price);
      this.color = color;
    }
    photo(){
      console.log('拍照')
    }

    call() {
        super.call();
        console.log('视频通话')
    }
  }

  let huawei = new  SmartPhone('hauwei',5999,'black')
  huawei.call()
  huawei.photo()
  console.log(huawei)
</script>
</body>
</html>